this.view = {headers: {"Content-Type": "text/javascript"}};

this.handler = function(req){
	
	this.get = function(){
		
		if(request.params.jq == "0")
			response.write(tmpl.render("jquery-1.2.6.min", {}));
		
		var contextAnchors = [];
		storage.anchors.get({
			where:{
				url: request.params.url,
				status: constants.get("anchorPendingStatus"),
			},
		}).forEach(function(row){
			var anchor = row.value;
			anchor.id = row.id;
			contextAnchors.push(anchor);
		});
		
		response.write(tmpl.render("main2", {contextUrl: request.params.url, contextAnchors: contextAnchors, selector: request.params.selector}));
	};
};